diff options
| author | Adam Soltys <[email protected]> | 2026-02-03 11:41:09 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-11 15:33:27 -0800 |
| commit | 4bc319a709d27bcdb805294e019d53e25f6e00c5 (patch) | |
| tree | 2ab903d969946ddd6129f2e6b796368adeef65cd /src/routes/(app)/pay/[username] | |
| parent | 8a6108a56c2e5035fd99c39ea13104cf23d98e2d (diff) | |
| download | coinos-ui-4bc319a709d27bcdb805294e019d53e25f6e00c5.tar.gz coinos-ui-4bc319a709d27bcdb805294e019d53e25f6e00c5.zip | |
fix warnings
Diffstat (limited to 'src/routes/(app)/pay/[username]')
| -rw-r--r-- | src/routes/(app)/pay/[username]/[...amount]/+page.svelte | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/routes/(app)/pay/[username]/[...amount]/+page.svelte b/src/routes/(app)/pay/[username]/[...amount]/+page.svelte index 618504ca..82fa3750 100644 --- a/src/routes/(app)/pay/[username]/[...amount]/+page.svelte +++ b/src/routes/(app)/pay/[username]/[...amount]/+page.svelte @@ -12,14 +12,19 @@ let { subject, rate, user } = $state(data); let currency = subject?.currency || "USD"; - let locale = $derived(loc(subject)); + let locale = $derived(() => loc(subject)); let next = $state(); let initialAmount = $derived(form?.amount || data.amount); - let amount = $state(initialAmount); - let fiat = $state(!initialAmount); + let amount = $state(); + let fiat = $state(); let formElement = $state(); + $effect(() => { + if (typeof amount === "undefined") amount = initialAmount; + if (typeof fiat === "undefined") fiat = !initialAmount; + }); + let setMax = async (e) => { e.preventDefault(); let body = new FormData(formElement); |
